/**
 * 
 */
package com.wsd.util;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.wsd.bean.Admin;

/**
 * @author Administrator
 *
 */
public class SysUtil {
	public static void login(Admin admin){
		ServletActionContext.getRequest().getSession().setAttribute("admin", admin);
	}
	
	public static void logout(){
		ServletActionContext.getRequest().getSession().removeAttribute("admin");
	}
	
	public static Admin currentAdmin(){
		return (Admin) ServletActionContext.getRequest().getSession().getAttribute("admin");
		//return (Admin) ActionContext.getContext().getSession().get("admin");
	}
}
